package android.support.v4.c;

import android.util.Log;
import java.io.Writer;

public final class b extends Writer
{
  private final String a;
  private StringBuilder b = new StringBuilder(128);

  public b(String paramString)
  {
    this.a = paramString;
  }

  private void a()
  {
    if (this.b.length() <= 0)
      return;
    Log.d(this.a, this.b.toString());
    this.b.delete(0, this.b.length());
  }

  public final void close()
  {
    a();
  }

  public final void flush()
  {
    a();
  }

  public final void write(char[] paramArrayOfChar, int paramInt1, int paramInt2)
  {
    int i = 0;
    if (i >= paramInt2)
      return;
    char c = paramArrayOfChar[(paramInt1 + i)];
    if (c == '\n')
      a();
    while (true)
    {
      while (true)
        i += 1;
      this.b.append(c);
    }
  }
}